﻿using System;

namespace ModuleGlobalMessage.Util
{
    /// <summary>
    /// 
    /// </summary>
    public class ItemShowBox
    {
        /// <summary>
        /// 
        /// </summary>
        public uint maxShowTime = 8;

        /// <summary>
        /// 
        /// </summary>
        public uint showTime = 8;

        /// <summary>
        /// 
        /// </summary>
        public string showContent = string.Empty;


        public ItemShowBox(string showContent)
        {
            this.showTime = this.maxShowTime;
            this.showContent = showContent;
        }



        public void Set(string messsage)
        {
            this.showTime = 8;
            this.showContent = messsage;
        }

        public void TimeDown()
        {
            CheckTime();

            showTime--;
        }

        internal void CheckTime()
        {
            if (showTime > this.maxShowTime)
            {
                showTime = this.maxShowTime;
            }
        }
    }
}
